/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Integrator.java
 *
 * Created on Jul 8, 2011, 12:47:03 PM
 */

package gem.gui.courses;

import gem.controller.AppController;
import gem.model.core.DepartmentCatalogueModel;
import java.sql.SQLException;

/**
 *
 * @author INVEST INTECH.COM
 */
public class Integrator extends javax.swing.JFrame
{

    private PnlCourses pnl_courses = null;
    private DepartmentCatalogueModel model  = null;
    private AppController controller = null;

    /** Creates new form Integrator */
    public Integrator( DepartmentCatalogueModel model, AppController ctrl )
    {
        initComponents();
        this.model = model;
        this.controller = ctrl;
        setComponents();
    }

    private void setComponents()
    {
        pnl_courses = new PnlCourses(controller);
        this.setContentPane(pnl_courses);
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) throws java.sql.SQLException
    {
        final gem.model.core.DepartmentCatalogueModel model = new gem.model.core.SimpleDepartmentCataloqueModel();
        final gem.controller.AppController myApp = new AppController(model);
        
        java.awt.EventQueue.invokeLater(new Runnable()
        {
            public void run()
            {
                new Integrator( model, myApp ).setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
